<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <style type="text/css">
        #tx {
            border-radius: 50%;
            width: 30px;
            height: 30px;
            display: inline;
            position: absolute;
            top: 7px;
            left: 3px;
        }

        .bg {
            background: linear-gradient(-59deg, rgba(109, 67, 229, 1), rgba(169, 93, 254, 1));
        }

        .rights2 {
            margin-left: 10px;
        }

        .rights {
            width: 40%;
            height: 100%;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            color: #fff;
            font-size: 14px;
            float: right;
            margin-right: 20px;
        }
    </style>
</head>
<body>
<div id="app">
    <header class="aui-bar aui-bar-nav bg" id="head">
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">
            <img src="../res/tx1.jpg" id="tx"/> 李宇春
        </div>
        <div class="rights">
            <div class="rights2" onclick="goadv()">
                投诉
            </div>
            <div class="rights2" @click="goadv2">
                拉黑
            </div>
        </div>
    </header>
</div>
</body>
<script type="text/javascript" src="../aui/js/aui.js"></script>
<script src="../script/vue2.js"></script>
<script src="../script/vue-resource.min.js"></script>
<script src="../script/jquery.min.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.parseTapmode();
        var html = '';
        var id = api.pageParam.id;
        var tx = api.pageParam.tx;
        var zh = api.pageParam.zh;
        html += '<img src="' + api.pageParam.tx + '" id="tx"/>' + api.pageParam.zh;
        $api.html($api.dom('.aui-title'), html);
        $api.fixStatusBar($api.byId('head'));
        var head_h = $api.offset($api.byId('head')).h;
        api.openFrame({
            name: 'frame_chat',
            url: 'frame_chat.html',
            bgColor: 'f5f5f5',
            rect: {
                x: 0,
                y: head_h,
                w: 'auto',
                h: api.winHeight - head_h - 52
            },
            hScrollBarEnabled: false,
            vScrollBarEnabled: false,
            pageParam: {
                head_h: head_h,
                id: id,
                zh: zh,
                tx: tx
            }
        });
    };

    function goadv() {
        api.openWin({
            name: 'reg',
            url: 'widget://html/my/advise.html',
            slidBackType: 'edge',
            vScrollBarEnabled: false,
            slidBackEnabled: false,
        })
    }

    function closeWin() {
        api.closeWin({});
    }

    var main = new Vue({
        el: "#app",
        data: {
            title: '登录',
            tel: '',

        },
        mounted: function () {
            var that = this;
        },
        methods: {
            goadv2: function () {
                var that = this;
                showProgress();
                api.ajax({
                    url: ajaxRoute.userban,
                    method: 'post',
                    data: {
                        values: {
                            token: $api.getStorage('userInfo').token,
                            uid: api.pageParam.id,
                        }
                    }
                }, function (ret, err) {
                    if (ret.code == 1) {
                        api.toast({msg: '拉黑成功', location: 'middle'});
                        closeWin()
                        api.sendEvent({
                            name: 'yuehuisx',
                        });
                    } else {
                        api.hideProgress();
                        api.toast({msg: ret.msg, location: 'middle'});
                    }
                });
            },
        },
        filters: {},
    })
</script>
</html>
